# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=strutscan
pkgver=4.8712c12
pkgrel=8
groups=('blackarch' 'blackarch-scanner')
pkgdesc='Apache Struts2 vulnerability scanner written in Perl.'
arch=('any')
url='https://github.com/riusksk/StrutScan'
license=('custom:unknown')
depends=('perl' 'perl-http-cookies' 'perl-uri' 'perl-libwww')
makedepends=('git')
source=("$pkgname::git+https://github.com/riusksk/StrutScan.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|# !/url/bin/perl -w|#!/usr/bin/perl -w|' StrutScan.pl
}

package() {
  cd $pkgname

  install -Dm 755 StrutScan.pl "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

